/**
 * 公共普通表单混入js，简化文件代码长度
 * 实例请看system/config的form.vue
 */
export default {
  props: {
    value: Boolean,
    row: Object,
    moduleName:String
  },
  computed: {
    visible: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      }
    }
  },
  data() {
    return {
      rowData: null,
      title: '',
      loading: false,
      submitting: false
    }
  },
  methods: {
    close(submit = false, msg) {
      if (submit === true) this.$emit('submit')
      this.$emit('close', submit === true)
      if (msg) submit === true ? this.$modal.msgSuccess(msg) : this.$modal.msgError(msg)
      this.visible = false
    },
  }
}
